if the commandKey is down and word 2 of position < 3 then add 1 to word 2 of position
if the optionKey is down and word 2 of position > -3 then subtract 1 from word 2 of position
if the shiftKey is down and fuel > 0 then put "modulef" into word 1 of position
else put "module" into word 1 of position
set the icon of cd btn "module" to position
if last char of word 1 of position is "f" then
if fireSound is false then
if the sound is "done" then play blowup a0h.
put true into fireSound
end if
subtract 1.25 from fallY
add .3 * word 2 of position to fallX
add .2 * abs (word 2 of position) to fallY
subtract 1 from fuel
if the random of 15 = 1 then commPlay "4 forward"
put "FUEL: " & fuel * 2 & "%" into cd fld "message"
else
if fireSound is true and the random of 8 = 1 then commPlay "engine"
put false into fireSound
if fuel < 1 then
if the sound is "done" then play beep c3e.
if word 1 of cd fld "message" is "FUEL:" then put "OUT OF FUEL" into cd fld "message"
end if
end if
add .5 to fallY
set the loc of cd btn "module" to item 1 of the loc of cd btn "module" + trunc(fallX), item 2 of the loc of cd btn "module" + trunc (fallY)
if the loc of cd btn "module" is not within "0,0,512,342" then
outOfBounds
exit repeat
end if
if item 1 of the loc of cd btn "module" > item 1 of the rect of cd btn "pad" and item 1 of the loc of cd btn "module" < item 3 of the rect of cd btn "pad" and item 2 of the loc of cd btn "pad" = item 2 of the loc of cd btn "module" + 3 then
if abs(fallY) >= 2 or abs(fallX) > 1 or (the icon of cd btn "module" <> 23961 and the icon of cd btn "module" <> 11865) then
bendModule
exit repeat
end if
landingSequence
exit repeat
end if
if item 2 of the loc of cd btn "module" + 2 > item round(item 1 of the loc of cd btn "module" / 10) + 1 of groundY then
crashModule
exit repeat
end if
if item 2 of the loc of cd btn "module" < item 2 of the loc of cd btn "pad" - 10 then set the hilite of cd btn "pad" to not the hilite of cd btn "pad"
else
set the hilite of cd btn "pad" to true
if the random of 10 = 1 then commPlay "3 feet"
if the random of 10 = 1 then commPlay "dust"
end if
if the random of 15 = 1 then play "eep"
if fallX >= 1 and fallX < 3 and the random of 10 = 1 then commPlay "drifting"
end repeat
go first
end startPlay
on crashModule
global fallY
play blowup c3w.
set the hilite of cd btn "pad" to false
repeat with count = 1 to 3
repeat 6 times
set the icon of cd btn "module" to "crash " & count
set the icon of cd btn "module" to "crash " & count + 1
end repeat
end repeat
lock screen
set the loc of cd btn "module" to item 1 of the loc of cd btn "module",item 2 of the loc of cd btn "module" + 10
set the icon of cd btn "module" to "crash 5"
unlock screen with visual effect dissolve
wait 1 seconds
dialog "Your poor landing has destroyed the spacecraft and " & "created a new lunar crater " & abs(fallY) * 5 & " feet deep."
end crashModule
on bendModule
play blowup c3w.
lock screen
set the icon of cd btn "module" to "crash 3"
unlock screen with visual effect dissolve
lock screen
set the icon of cd btn "module" to "bent"
unlock screen with visual effect dissolve
dialog "Your poor landing has severely damaged the lunar module. "
end bendModule
on landingSequence
set the icon of cd btn "module" to "module 0"
repeat while the sound is not "done"
end repeat
commPlay "landed"
show cd btn "flag" at item 1 of the loc of cd btn "module" + 17, item 2 of the loc of cd btn "module" - 3
play silence c4e
repeat while the sound is not "done"
end repeat
wait 1 seconds
dialog "Congratulations on a successful landing!"
end landingSequence
on outOfBounds
hide cd btn "module"
play beep c3e.
dialog "The lunar module has drifted out of the landing area and is now floating out of control."
end outOfBounds
on commPlay whichNoise
if the sound is not "done" then exit commPlay
play blowup g4s
play silence c4s.
play whichNoise
play silence c4s.
play blowup g4s
if whichNoise is not "copy" and whichNoise is not "landed" and the random of 5 = 1 then
play silence c4e.
play "copy"
play silence c4e.
play blowUp g4s
end if
end commPlay
on dialog mess
global startTime
put mess & return & return & "Elapsed time for this mission: " & (the ticks - startTime) / 60 & " seconds" into cd fld "dialog"
show cd fld "dialog"
show cd btn "OK"
show cd btn "cover"
set the cursor to hand
repeat while the visible of cd btn "cover" is true
if the mouseClick then click at the clickLoc
end repeat
end dialog
on closeDialog
set the cursor to watch
hide cd btn cover
hide cd btn "OK"
hide cd fld "dialog"
end closeDialog
-- part 7 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=237 top=10 right=49 bottom=454
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 2
-- text size: 12
-- style flags: 10496
-- line height: 16
-- part name: message
-- part 1 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=28 top=10 right=55 bottom=62
-- title width / last selected line: 0
-- icon id / first selected line: 23961 / 23961
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: module
-- part 2 (button)
-- low flags: 00
-- high flags: 4000
-- rect: left=304 top=252 right=264 bottom=337
-- title width / last selected line: 0
-- icon id / first selected line: 16745 / 16745
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: pad
-- part 3 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=380 top=302 right=329 bottom=397
-- title width / last selected line: 0
-- icon id / first selected line: 19292 / 19292
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Flag
-- part 4 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=0 top=0 right=343 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: cover
----- HyperTalk script -----
on mouseDown
beep
end mouseDown
-- part 5 (field)
-- low flags: 81
-- high flags: 2004
-- rect: left=84 top=57 right=174 bottom=409
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 8448
-- line height: 16
-- part name: dialog
-- part 6 (button)
-- low flags: 80
-- high flags: A003
-- rect: left=331 top=145 right=166 bottom=399
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: OK
----- HyperTalk script -----
on mouseUp
closeDialog
end mouseUp
-- part contents for card part 7
----- text -----
FUEL: 98%
-- part contents for card part 5
----- text -----
Your poor landing has destroyed the spacecraft and created a new lunar crater 74.75 feet deep.